package org.stormphoenix.bbsfamily.controller


open class BaseController {
    fun returnSuccess(desc: DescEnum, message: String? = null, data: Any? = null): CommonResult<Any> {
        return CommonResult(status = CommonResult.success, message = message ?: desc.description, data = data)
    }

    fun returnError(desc: DescEnum, error: String? = null, data: Any? = null): CommonResult<Any> {
        return CommonResult(status = desc.code, message = "failed", error = error ?: desc.description, data = data)
    }
}